'use strict';

//项目主入口模块
angular.module('appModule', [
    'config',
    'ui.router',
    'listModule.controller',
    'detailModule.controller',
    'crossModule.service'
])
    .controller('appController',['$scope',function($scope){
        $scope.$on('active-Type',function(event,data){
            $scope.type=data
        })
        $scope.search='';
        $scope.searchBtn=function(){
            $scope.$broadcast('search-btn',$scope.search)
        }
    }])
    .config(['$stateProvider','$urlRouterProvider', function($stateProvider,$urlRouterProvider) {
        $stateProvider
            .state('list',{
                url:'/list/:type',
                templateUrl:'./areas/list/list.html',
                controller:'listController'
            })
            .state('detail',{
                url:'/detail/:type',
                templateUrl:'./areas/detail/detail.html',
                controller:'detailController'
            })
        $urlRouterProvider.otherwise('/list/in_theaters');
    }]);
